package test;

import java.util.Comparator;
import java.util.Date;

public class Employee implements Comparable<Employee>{

	int id;
	String name;
	Date date;
	public Employee(int id, String name, Date date) {
		super();
		this.id = id;
		this.name = name;
		this.date = date;
	}
	@Override
	public String toString() {
		return "Employee [id=" + id + ", name=" + name + ", date=" + date + "]";
	}

	@Override
	public int compareTo(Employee o) {
		return this.id - o.id;
	}
	
	public static Comparator<Employee> NameComparator = new Comparator<Employee>() {
		 
        @Override
        public int compare(Employee e1, Employee e2) {
            return e1.name.compareTo(e2.name);
        }
    };
	
}
